package com.mvp.shq.washer.entity;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/8/24.
 */

public class TokenBean {

    /**
     * token : eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxMzY1NTk0NTU5MyIsImF1ZGllbmNlIjoid2ViIiwiY3JlYXRlZCI6MTUwMzU4MDM3Mzc3OSwiZXhwIjoxNTA2MTcyMzczfQ.k8DrlLZ6kedcbifglgw6n69RY7rw9TWHwhlgex1-PRuUAWlSlEgzyJ-IXHEsbiAxk50GZ0lp4DxEb8C3RQRlMg
     * userId : 2
     */

    private String token;
    private String mobileUserId;

    public static TokenBean objectFromData(String str) {

        return new Gson().fromJson(str, TokenBean.class);
    }

    public static List<TokenBean> arrayTokenBeanFromData(String str) {

        Type listType = new TypeToken<ArrayList<TokenBean>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getUserId() {
        return mobileUserId;
    }

    public void setUserId(String userId) {
        this.mobileUserId = userId;
    }
}
